<script setup>
import { ref, onMounted, onUnmounted, onActivated, onDeactivated } from 'vue'
const count = ref(0)
onMounted(() => {
  console.log('挂载')
})
onUnmounted(() => {
  console.log('卸载')
})
onActivated(() => {
  console.log('激活')
})
onDeactivated(() => {
  console.log('失活')
})
</script>

<template>
  <div>
    <h1>首页</h1>
    <button @click="count++">点击了{{ count }}次</button>
  </div>
</template>

<style scoped></style>
